package com.service.gmall.product.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.service.gmall.model.product.SkuInfo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
* @author alpha
* @description 针对表【sku_info(库存单元表)】的数据库操作Mapper
* @createDate 2022-08-23 10:15:19
* @Entity com.service.gmall.product.domain.SkuInfo
*/
public interface SkuInfoMapper extends BaseMapper<SkuInfo> {
    /**
     * @param skuId
     * @description: 获取实时价格
     * @return: java.math.BigDecimal
     * @author: alpha
     * @date: 2022/8/26 23:23
     */
    BigDecimal getRealTimePrice(@Param("skuId") Long skuId);

    /**
     * 更新 sku的is_sale字段
     * @param skuId
     * @param sale
     */
    void updateIsSale(@Param("skuId") Long skuId, @Param("sale") int sale);

    /**
     * 查询所有的skuid
     * @return
     */
    List<Long> getAllSkuId();

}




